package com.limh.base.adapter

import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter
import com.limh.base.base.BaseFragment

/**
 * @author limh
 * @function fragment适配器
 * @date 2018/4/18 11:10
 */
class FragmentAdapter(fm: FragmentManager, private val fragments: List<BaseFragment>?) : FragmentPagerAdapter(fm) {

    override fun getItem(position: Int): Fragment {
        return fragments!![position]
    }

    override fun getCount(): Int {
        return fragments?.size ?: 0
    }
}
